BlueCielo Meridian Global Collaboration Framework 2012 SP1 Administrator's Guide | BlueCielo ECM Solutions

You are here: About the advanced features > VBScript examples > Understanding table data replication > UpdateTable example

UpdateTable example

The UpdateTable function in the class BlueCieloECM.GcfSupport retrieves data from a specified remote vault and merges the received data into a local table. For a detailed description of this function, see UpdateTable function.

A convenient point to call this function is upon the creation of a GCF briefcase. The following example uses two tables, Test1 (row ownership) and Test2 (additive replication) that are updated when the scheduled transfer of briefcases takes place:

Dim bTableUpdateDone

Sub BrcEvent_BeforeCreate (Briefcase, Abort) 'The export processor sets CurrentTransfer.
  If IsArray (Vault.Argument ("CurrentTransfer")) Then 'Check CurrentTransfer for a scheduled transfer
    If Vault.Argument ("CurrentTransfer")(5) Then 'bTableUpdateDone is initially empty when the scheduled transfer starts. 'By setting it to True during processing, repeated updates 'in a single update run are avoided.
      If Not bTableUpdateDone = True Then
        Set objGCFSupport = AMCreateObject("BlueCieloECM.GcfSupport", False)
        objGCFSupport.UpdateTable Vault.Table ("Test1"), "GCF2", _
                                        Array ("Key1", "Key2"), "Owner"
        objGCFSupport.UpdateTable Vault.Table ("Test2"), "GCF2", Array ("Key"), "" 
        Set objGCFSupport = Nothing
        bTableUpdateDone = True
      End If
    End If
  End If
End Sub

Note    The names of arguments of the Vault.Argument property are case-sensitive.

The Test1 table contains the following columns:

The Test2 table contains the following columns:

The data in Test1 is replicated in the preceding example by the first call to UpdateTable. The call specifies the combination of Key1 and Key2 as the primary key and Owner as the owner column.

The data in Test2 is replicated in the preceding example by the second call to UpdateTable. The call specifies Key as the primary key and no owner column.

Assume the following table data before update.

Vault GCF1, table Test1

Key1

Key2

Data1

Data2

Owner

K1.1

K1.2

D1.1

D1.2New

GCF1

K2.1

K2.2

D2.1

D2.2

GCF2

K3.1

K3.2

D3.1

D3.2

GCF2

Vault GCF1, table Test2

Key

Data

K1

D1

K2

D2New

Vault GCF2, table Test1

Key1

Key2

Data1

Data2

Owner

K1.1

K1.2

D1.1

D1.2

GCF1

K2.1

K2.2

D2.1New

D2.2

GCF2

K4.1

K4.2

D4.1

D4.2

GCF2

Note    The row containing K3.1 has been deleted.

Vault GCF2, table Test2

Key

Data

K1

D1New

K2

D2

K3

D3

The data in the tables in GCF1 will be as follows after the two calls to UpdateTable:

Vault GCF1, table Test1

Key1

Key2

Data1

Data2

Owner

K1.1

K1.2

D1.1

D1.2New

GCF1

K2.1

K2.2

D2.1New

D2.2

GCF2

K4.1

K4.2

D4.1

D4.2

GCF2

Vault GCF1, table Test1

Key

Data

K1

D1New

K2

D2New

K3

D3

Related concepts

Centralizing sequence number generation

Understanding table data replication

Related tasks

Transferring ownership upon release

Calculating import notification messages

Executing remote script functions

Calculating document names

Requesting a document name

Handling hub vault unavailability

Enlisting all sites for new documents

Customizing site delistment


Copyright © 2000-2012 BlueCielo ECM Solutions

www.bluecieloecm.com